package com.night.icm.controller.core;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 〈一句话功能简述〉<br> 
 * 〈测试swagger接口〉
 *
 * @author 智勇
 * @create 2019/11/30
 * @since 1.0.0
 */
@RestController
@RequestMapping("/api/swagger")
@Api(value="示例接口Controller")
public class SwaggerController {

    @ApiOperation(value="示例接口", notes="示例接口" ,httpMethod="POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name="name", value="用户姓名", dataType = "String", required=true, paramType="form"),
            @ApiImplicitParam(name="id", value="id", dataType = "int", required=false, paramType="form")
    })
    @GetMapping("hello")
    public String helloWord(String name, Integer id) {
        return "Hello Word";
    }

    @ApiOperation(value = "根据id查询用户信息", notes = "查询数据库中某个用户信息")
    @ApiImplicitParam(name = "id", value = "用户ID", paramType = "form", required = true, dataType = "Integer")
    @GetMapping(value = "/{id}")
    public String getStudent(@PathVariable int id) {
        return "one user";
    }
}